package com.jzy.message.activities.base;
/**
 * Created by Administrator on 2016/6/13.
 */
import org.xutils.http.RequestParams;

public class AppRequestInterface {
    //用户接口
    public static String sUserLoginUrl=AppConfig.JsonUrl + "/user/users/login";
    public static String sCheckUserNameUrl=AppConfig.JsonUrl + "/registeruser/checkusernamevalid";
    public static String sCheckEmailUrl=AppConfig.JsonUrl + "/registeruser/checkemailvalid";
    public static String sRegisterUserUrl=AppConfig.JsonUrl + "/registeruser/register";

    //home
    public static String sGetLatestBlogsUrl=AppConfig.JsonUrl + "/bloglist/getupvideoblogs";//获取最新博客
    public static String sGetVideoBlogs=AppConfig.JsonUrl+"/bloglist/getvideoblogs";//获取后续更多博客
    public static String sGetLiveListUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/live/getroomlist";//获取直播列表
    public static String sAddSupportUrl=AppConfig.JsonUrl+"/likeblogs/addlike";//对博客点赞
    public static String sAddDiscussUrl=AppConfig.JsonUrl+"/blogcomments/appendcomment";//对博客评论
    public static String sGetReportTypeUrl=AppConfig.JsonUrl+"/blogreporttypes/getreporttypes";//获取举报类型
    public static String sReportBlogUrl=AppConfig.JsonUrl+"/blogreports/report";//对博客举报
    public static String sAddAttentionUrl=AppConfig.JsonUrl+"/videoblogs/attentions/addattention";//添加关注
    public static String sDeleteAttentionUrl=AppConfig.JsonUrl+"/videoblogs/attentions/deleteattention";//取消关注


    public static String sShareBlogUrl=AppConfig.JsonUrl+"/videoblogsmessage/shareblogs";//分享博客
    public static String sDiscussBlogUrl=AppConfig.JsonUrl+"/blogcomments/appendcomment";//添加评论
    public static String sGetDiscussListUrl=AppConfig.JsonUrl+"/blogcomments/findcomments";//获取评论
    public static String sDeleteBlogUrl=AppConfig.JsonUrl+"/videoblogsmessage/delete";//删除博客
    public static String sPublishPhotoBlogUrl=AppConfig.JsonUrl+"/uploadblog/uploadphoneimageblogs";//发布图片博客
    public static String sPublishVideoBlogUrl=AppConfig.JsonUrl+"/uploadblog/uploadphonevideoblogs";//发布视频博客 增加rate -1 慢播 0 正常 1 快播

    //Search
    public static String sRecommondBlogsUrl=AppConfig.JsonUrl+"/searchvideoblogs/recommendedblog?isphoneclient=true";
    public static String sRecommondBlogsUrl2=AppConfig.JsonUrl+"/searchvideoblogs/getvideoblogsbyvideoblogdto";
    public static String sSearchByPeopleUrl=AppConfig.JsonUrl+"/referee/getreferee";//按人搜索
    public static String sSearchByTagUrl=AppConfig.JsonUrl+"/blogtags/findtags";//按标签搜索
    public static String sSearchByPlaceUrl=AppConfig.JsonUrl+"/searchvideoblogs/findaddress";//按位置搜索
    public static String sSearchByLiveUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/live/searchroom";//搜索直播
    public static String sGetRoomListUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/live/getroomlist";//获取直播列表
    //Me
    public static String sBlogsOfUserUrl=AppConfig.JsonUrl+"/userblogslist/getvideoblogsbyuserid";//获取个人博客信息
    public static String sBlogsOfFollowinUrl=AppConfig.JsonUrl+"/attentions/getfollowin";//获取我follow的人
    public static String sBlogsOfFollowerUrl=AppConfig.JsonUrl+"/attentions/getfollower";//获取我的粉丝

    //Function -live
    public static String sCreateLiveRoomUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/live/createroom";//创建直播房间
    public static String sEnterLiveRoomUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/live/enterroom";//进入直播房间
    public static String sDeleteLiveRoomUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/live/deleteroom";//主播退出直播房间
    public static String sLeaveLiveRoomUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/live/leaveroom";//观看者退出直播房间
    public static String sGetServiceUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/getserviceurl";//获取服务地址
    public static String sUpdateXmppGroupNameToServerUrl="http://"+AppConfig.LiveIP+":"+AppConfig.LivePort+"/live/updatexmppgid";

    //Function -conference
    public static String sGetServerIP_ConferenceUrl="http://"+AppConfig.telepresence_server+":"+AppConfig.conference_port+"/videoconf/getServerIP";//获取视频服务器的IP
    public static String sGetConferenceNOUrl="http://"+AppConfig.telepresence_server+":"+AppConfig.conference_port+"/videoconf/getConferenceNO";//获取房间号
    public static String sReturnConferenceNOUrl="http://"+AppConfig.telepresence_server+":"+AppConfig.conference_port+"videoconf/returnConferenceNO";//退出视频通话
    //Message
    public static String sMessageFollowingUrl=AppConfig.JsonUrl+"/message/getmymessage";//获取following信息
    public static String sMessageMeUrl=AppConfig.JsonUrl+"/message/getfollowinmessage";//获取me消息
    public static String sMessageContactUrl=AppConfig.JsonUrl+"/attentions/getfriends";//获取好友列表
/*    public static String getImg128Url1(String Image128Id,String AuthorUserId)
    {
        String url= AppConfig.JsonUrl+"/Areas/VideoBlogs/Images/ThumbnailsLoadHandler.ashx?id="+Image128Id+"&videoAuthorId="+AuthorUserId;
        return url;
    }*/
    //定义Code返回定义
    public static String Sucess0="0";
    public static String Sucess = "S000";
    public static String ErrorForNotLogin = "E001";
    public static String ErrorForNotFound = "E002";
    public static String ErrorForPasswordWrong = "E003";
    public static String ErrorForRepeated = "E004";
    public static String ErrorForDb = "E005";
    public static String ErrorForInputError = "E006";
    public static String ErrorForConfigurationSettingFile = "E007";
    public static String ErrorForUnchecked = "E008";
    public static String ErrorForSellOut = "E009";
    public static String ErrorForHasBeenUsed = "E010";
    public static String ErrorForPublished = "E011";
    public static String ErrorForNotMeetMiniversion = "E012";
    public static String ErrorForSendEmailFail = "E013";
    public static String ErrorForSupportFailed = "E014";
    public static String ErrorForBlogDisable = "E103";
    public static String ErrorForSaveDataFail = "E104";
    public static String ErrorForUnKnown = "E100";
    public static String ErrorForUserAlreadyExists = "E101";
    public static String ErrorForUserRegiterFail = "E102";
    public static String ErrorForUserVerification = "E103";
    public static String ErrorForUserNameOrPassword = "E104";
    public static String ErrorForCheckCodeTimeOut = "E105";
    public static String ErrorForInBlack = "E106";
    public static String ErrorForPermission = "E107";
    public static String ErrorForMySqlDb = "E108";
    public static String ErrorForProtected = "E109";
    public static String ErrorForAlreadyExists = "E111";
    public static String ErrorForShare = "E200";
    public static String ErrorForUpload = "E201";

    public enum RequestType {
        Request_UserLogin,//用户登录请求
    };
    public static RequestParams GetRequestPara(RequestType type)
    {
        String RequestPara_Url="";
        switch (type) {
            case Request_UserLogin://用户登录
                RequestPara_Url=sUserLoginUrl;
                break;
            default:
                break;
        }
        if(RequestPara_Url.equals(""))
            return null;
        RequestParams params = new RequestParams(RequestPara_Url);
        return params;
    }
    public static String getUserAvatarImageUrl(String userId)
    {
        return AppConfig.sPic_Video_ServerIP+"/avatarimage/userid/"+userId;
    }
    public static String getUserAvatarImageUrlByUserName(String userName)
    {
        return AppConfig.sPic_Video_ServerIP+"/avatarimage/username/"+userName;
    }
}
